/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package scubalogbook.data;

import java.io.File;
import javax.swing.filechooser.*;
import scubalogbook.Common;


/**
 *
 * @author vkorecky
 */

public class ScubaLogbookFilesFilter extends FileFilter
{
    public final static String ScubaLogbookExtension = "slog";
    
    @Override
    public boolean accept(File file) {
        if (file.isDirectory()) {
            return true;
        }

        String extension = Common.getExtension(file);
        if (extension != null) {
            if (extension.equals(ScubaLogbookExtension)) {
                    return true;
            } else {
                return false;
            }
        }

        return false;
    }

    @Override
    public String getDescription() {
        return "ScubaLogbook files (*." + ScubaLogbookExtension + ")";
    }         
}
